# #!/usr/bin/env python3
# # coding:utf-8
# import requests
# # from admin.core.task import add_task
# import json
# server_url = 'https://rest-hangzhou.goeasy.io/publish/'
#
# def test_go():
#     data = {'appkey': 'BC-73a09621d2b24c2cbc33e765c2ee878a',
#             'channel':'notification', 'content': '一个新的任务',
#             'userId':add_task.user_id,'username': add_task.user_id.name}
#     url = server_url
#     headers = {'Content-Type': 'application/json'}
#     r = requests.post(url, data=data, headers=headers)
#     # r = requests.post(url, json=data, headers=headers)
#     print(type(r))
#     print(r.json())
#
# test_go()
#
# # if __name__ == '__main__':
# #     pass
#
# # def goeasy():
# #     """获取进行中的任务"""
# #     # tmp = {}
# #     # data = []
# #     # tasks = Task.query.filter(Task.start_time < datetime.now()).filter(
# #     #     Task.end_time > datetime.now())
# #     # for item in tasks:
# #     #     data.append(item.get_dic())
# #     # tmp['success'] = 1
# #     # tmp['error_code'] = None
# #     # tmp['error_msg'] = None
# #     # tmp['data'] = data
# #     # return jsonify(tmp)
# #     return 111
#
